using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.System;

/// <summary>
/// 编码生成历史记录表
/// </summary>
public class SysCodeHistory : TopBasePoco, ITenant
{
    [Display(Name = "编码规则", Description = "关联的编码规则", GroupName = "关联信息")]
    public SysCodeRule CodeRule { get; set; }

    [Display(Name = "编码规则ID", Description = "编码规则的ID", GroupName = "关联信息")]
    public Guid CodeRuleId { get; set; }

    [Display(Name = "生成编码", Description = "生成的完整编码", GroupName = "编码信息")]
    [Required]
    [MaxLength(64)]
    public string GeneratedCode { get; set; }

    [Display(Name = "业务单据ID", Description = "使用此编码的业务单据ID", GroupName = "业务信息")]
    public Guid? BusinessId { get; set; }

    [Display(Name = "业务类型", Description = "业务单据的类型", GroupName = "业务信息")]
    [MaxLength(32)]
    public string BusinessType { get; set; }

    [Display(Name = "序号值", Description = "生成时使用的序号", GroupName = "编码信息")]
    public int SerialNumber { get; set; }

    [Display(Name = "生成时间", Description = "编码生成的时间", GroupName = "时间信息")]
    public DateTime GenerateTime { get; set; } = DateTime.Now;

    [Display(Name = "操作人", Description = "生成编码的操作人", GroupName = "操作信息")]
    [MaxLength(50)]
    public string Operator { get; set; }

    [Display(Name = "备注", Description = "备注信息", GroupName = "其他")]
    [MaxLength(256)]
    public string Remark { get; set; }

    [Display(Name = "租户代码", Description = "多租户系统中的租户唯一标识", GroupName = "系统设置")]
    [MaxLength(128)]
    public string TenantCode { get; set; }
}
